<ul class="nav nav-pills">
<?php foreach ($users as $user):?>
    <li><a href="#"><?php echo $user->username ?></a></li>
<?php endforeach; ?>
</ul>